use strict;
use warnings;

use geneGenerator ;
use GSEA::FileReading::FileReader; 
use GSEA::ES::EScalculator; 
use GSEA::Chart::ChartCreator;

use GSEA::Pvalue::Permutor ;
use GSEA::Pvalue::PvalueCalculator;

my $gg = geneGenerator->constrGeneGenerator(200,".\\files\\file_1.txt" , 25 , ".\\files\\file_2.txt" );
$gg->generateFiles();


my $L_file_name = ".\\files\\file_1.txt" ;
my $S_file_name = ".\\files\\file_2.txt" ;


my $fileReader = GSEA::FileReading::FileReader->constrFileReader( $L_file_name, $S_file_name ) ;
my @L_table = $fileReader->read_Lfile();
my @S_table = $fileReader->read_Sfile();

my $Npermutations = 1000 ;
my $Pparameter = 2 ;

my $permuteur = GSEA::Pvalue::Permutor->constrPermutor( ($#S_table+1) , \ @L_table  , $Npermutations , $Pparameter);

my $drawer = GSEA::Chart::ChartCreator->constrChartCreator(".\\graphout\\graphout.exe",800,800);
#
#@data = $calculator->getCourb();

#$drawer->drawEScourb( $name1 , \@pvalue1 );
#$drawer->drawEScourb( $name2 , \@pvalue2 );

#
#@data = $calculator->getDistribution();
#$drawer->drawGeneSetDistribution(".\\out\\distribution" , \@data );
#
my @data = $permuteur->getScores() ;
$drawer->drawScoreDistribution( ".\\out\\scoresDistrib" , \@data);


system(".\\out\\batch");
